#ifndef FND_GAME_RACING_MAIN_GAME_SHELL_H
#define FND_GAME_RACING_MAIN_GAME_SHELL_H
#include <iservershell.h>
#include <boost/noncopyable.hpp>
#include <utility>
#include <vector>
#include <boost/scoped_ptr.hpp>
class world_properties ;
class server_physics ;
class car_road_info_manager ;
class light_system ;
typedef std::pair<HCLIENT, ILTMessage_Read*> server_message_param_type ;

namespace Utility {
    
class node_record_manager ;
}

namespace GameLogic {
    class car ;
}

struct binding_shader_info_type {
    HCLIENT Hclient ;
    HOBJECT Object ;
    std::string Name ;
    binding_shader_info_type(HCLIENT h,
                             HOBJECT o,
                             const std::string& s) :
        Hclient(h),
        Object(o),
        Name(s) {}
} ;

class game_logic_shell : boost::noncopyable {
public:
    game_logic_shell() ;
    virtual ~game_logic_shell() ;

    virtual void on_server_term() = 0 ;

    virtual void poststart_world() = 0 ;
    virtual void update(float time_elapsed) = 0 ;
    virtual void on_add_client(HCLIENT hclient) = 0 ;
    virtual void on_remove_client(HCLIENT hclient) = 0 ;

    virtual LPBASECLASS on_client_enter_world(HCLIENT hClient) = 0 ;
    virtual void on_client_exit_world(HCLIENT hclient) = 0 ;
    virtual void on_message(HCLIENT hSender, ILTMessage_Read* pMessage) = 0;
    virtual void on_object_message(LPBASECLASS pSender, uint32 messageID,
                                   ILTMessage_Read* pMsg) = 0 ;

    light_system* lightsystem() {return m_light_system.get() ;}
private:
    boost::scoped_ptr<light_system> m_light_system ;
protected:
    
    static LPBASECLASS create_jupiter_car(const char* intance_name) ;
    static void send_create_binding_shader_message(HCLIENT hclient,
                                                   LPBASECLASS,
                                                   const char* name) ;
    static void create_attachment(LPBASECLASS) ;
    static void send_all_binding_infos() ;
    static std::vector<binding_shader_info_type> ms_shader_infos ;
    

    
} ;

#endif
